﻿using HP.HPTRIM.SDK;
using System.IO;

namespace DocumentAccess
{
    class Program
    {
        static void Main(string[] args)
        {
          //  TrimApplication.TrimBinariesLoadPath = @"YOUR TRIM BINARY PATH";
            TrimApplication.Initialize();


            using (Database database = new Database())
            {
                database.Id = "I1";
                database.TrustedUser = "itu_tadmin";
                database.Connect();

                Record rec = new Record(database, "YOUR RECORD NUMBER");
                TrimDocumentStream docStream = new TrimDocumentStream(rec);
                var fileStream = File.Create("C:\\MyTest\\" + rec.SuggestedFileName);

                docStream.CopyTo(fileStream);
                fileStream.Close();



            }
        }
    }
}
